<?php

namespace App\Services\Tenancy;


use App\Models\CompanyModel;
use Illuminate\Support\Facades\Cache;

class Tenancy
{

    /**
     * 生成select查询数组
     * @return array
     */
    public static function selectLis():array
    {
        $select = CompanyModel::query()->get();
        $list  = [];
        foreach ( $select as $item ) {
            $list[$item->id] = $item->cur_type == CompanyModel::TYPE_PERSON?$item->contact_person_name:$item->company_name;
        }
        return $list;
    }

    /**
     * @return mixed
     */
    public static function getTenantId(): int
    {
        return auth('company')->id()??0;
    }
}
